package com.strange.mdl.module.mdl.dal.mysql.debatehallcomment;

import java.util.*;

import com.strange.mdl.framework.common.pojo.PageResult;
import com.strange.mdl.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.strange.mdl.framework.mybatis.core.mapper.BaseMapperX;
import com.strange.mdl.module.mdl.dal.dataobject.debatehallcomment.DebateHallCommentUserDO;
import com.strange.mdl.module.mdl.dal.dataobject.debatehallcomment.DebatehallCommentDO;
import org.apache.ibatis.annotations.Mapper;
import com.strange.mdl.module.mdl.controller.admin.debatehallcomment.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 辨经殿话题评论 Mapper
 *
 * @author 密谛灵总控
 */
@Mapper
public interface DebatehallCommentMapper extends BaseMapperX<DebatehallCommentDO> {

    default PageResult<DebatehallCommentDO> selectPage(DebatehallCommentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DebatehallCommentDO>()
                .eqIfPresent(DebatehallCommentDO::getContent, reqVO.getContent())
                .betweenIfPresent(DebatehallCommentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DebatehallCommentDO::getId));
    }

    List<DebatehallCommentDO> commentByDetail(@Param("debateId") Long debateId, @Param("userId") Long userId);

    DebatehallCommentDO commentById(@Param("id") Long id, @Param("userId") Long userId);

    DebatehallCommentDO selectCommentById(Long id);

    int insertComment(DebatehallCommentDO comment);

    int updateComment(DebatehallCommentDO comment);

    int deleteCommentById(Long id);

    List<DebatehallCommentDO> selectCommentList();

    DebateHallCommentUserDO selectCommentUsers(@Param("commentId") Long commentId, @Param("userId") Long userId);
    int updateCommentUsers(DebateHallCommentUserDO entity);
    int insertCommentUsers(DebateHallCommentUserDO entity);

}